import request from '@/utils/request'

// 查询运单列表
export function listWaybills(query) {
  return request({
    url: '/system/waybills/list',
    method: 'get',
    params: query
  })
}

// 查询运单详细
export function getWaybills(id) {
  return request({
    url: '/system/waybills/' + id,
    method: 'get'
  })
}

// 新增运单
export function addWaybills(data) {
  return request({
    url: '/system/waybills',
    method: 'post',
    data: data
  })
}

// 修改运单
export function updateWaybills(data) {
  return request({
    url: '/system/waybills',
    method: 'put',
    data: data
  })
}

// 删除运单
export function delWaybills(id) {
  return request({
    url: '/system/waybills/' + id,
    method: 'delete'
  })
}


export function signStateChange(ids) {
  return request({
    url: '/system/waybills/signStateChange',
    method: 'post',
    data: ids
  })
}

/**
 * 回退运单步骤
 * @param data 包含id和rebackState的对象
 */
export function rebackState(data) {
  return request({
    url: '/system/waybills/rebackState',
    method: 'post',
    data: data
  })
}

